package cn.car91.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import cn.car91.R;

public class WeizhangResponseAdapter extends BaseAdapter {
    private List<WeizhangResponseHistoryJson> mDate;
    private Context mContext;

    public class WeizhangResponseHistoryJson {
        private String occur_date;
        private String fen;
        private String money;
        private String occur_area;
        private String info;

        public String getOccur_date() {
            return occur_date;
        }

        public void setOccur_date(String occur_date) {
            this.occur_date = occur_date;
        }

        public String getFen() {
            return fen;
        }

        public void setFen(String fen) {
            this.fen = fen;
        }

        public String getMoney() {
            return money;
        }

        public void setMoney(String money) {
            this.money = money;
        }

        public String getOccur_area() {
            return occur_area;
        }

        public void setOccur_area(String occur_area) {
            this.occur_area = occur_area;
        }

        public String getInfo() {
            return info;
        }

        public void setInfo(String info) {
            this.info = info;
        }
    }

    public WeizhangResponseHistoryJson instanceWeizhangResponseHistoryJson() {
        return new WeizhangResponseHistoryJson();
    }

    public List<WeizhangResponseHistoryJson> getmDate() {
        return mDate;
    }

    public void setmDate(List<WeizhangResponseHistoryJson> mDate) {
        this.mDate = mDate;
    }

    public WeizhangResponseAdapter(Context mContex, List mDate) {
        this.mContext = mContex;
        this.mDate = mDate;
    }

    @Override
    public int getCount() {
        return mDate.size();
    }

    @Override
    public Object getItem(int position) {
        return mDate.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = View.inflate(mContext, R.layout.csy_listitem_result, null);
        // 获取ID
        WeizhangResponseHistoryJson model = mDate.get(position);

        TextView wz_time = (TextView) view.findViewById(R.id.wz_time);
        TextView wz_money = (TextView) view.findViewById(R.id.wz_money);
        TextView wz_addr = (TextView) view.findViewById(R.id.wz_addr);
        TextView wz_info = (TextView) view.findViewById(R.id.wz_info);
        // 填写值

        wz_time.setText(model.getOccur_date());
        wz_money.setText("计" + model.getFen() + "分, 罚" + model.getMoney() + "元");
        wz_addr.setText(model.getOccur_area());
        wz_info.setText(model.getInfo());

        return view;
    }

}
